/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package pkg_entidades;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author Oswaldo
 */
@Entity
@Table(name = "sfot_fotos", catalog = "sisventas_db", schema = "public")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Fotos.findAll", query = "SELECT f FROM Fotos f"),
    @NamedQuery(name = "Fotos.findByFotCodigo", query = "SELECT f FROM Fotos f WHERE f.fotCodigo = :fotCodigo"),
    @NamedQuery(name = "Fotos.findByFotFoto", query = "SELECT f FROM Fotos f WHERE f.fotFoto = :fotFoto")})
public class Fotos implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "fot_codigo")
    private Integer fotCodigo;
    @Size(max = 254)
    @Column(name = "fot_foto")
    private String fotFoto;
    @JoinColumn(name = "aos_codigo", referencedColumnName = "aos_codigo")
    @ManyToOne
    private Artiserv aosCodigo;

    public Fotos() {
    }

    public Fotos(Integer fotCodigo) {
        this.fotCodigo = fotCodigo;
    }

    public Integer getFotCodigo() {
        return fotCodigo;
    }

    public void setFotCodigo(Integer fotCodigo) {
        this.fotCodigo = fotCodigo;
    }

    public String getFotFoto() {
        return fotFoto;
    }

    public void setFotFoto(String fotFoto) {
        this.fotFoto = fotFoto;
    }

    public Artiserv getAosCodigo() {
        return aosCodigo;
    }

    public void setAosCodigo(Artiserv aosCodigo) {
        this.aosCodigo = aosCodigo;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (fotCodigo != null ? fotCodigo.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Fotos)) {
            return false;
        }
        Fotos other = (Fotos) object;
        if ((this.fotCodigo == null && other.fotCodigo != null) || (this.fotCodigo != null && !this.fotCodigo.equals(other.fotCodigo))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "pkg_entidades.Fotos[ fotCodigo=" + fotCodigo + " ]";
    }
    
}
